/* $Id: MapFrameFactory.java 63 2010-02-14 13:52:34Z aaron.day $ */
package org.crazydays.gameplan.map.swing;


import org.crazydays.gameplan.map.GameMap;

/**
 * MapFrameFactory
 */
public class MapFrameFactory
{
    /** map mouse listener */
    protected MapMouseListener mouseListener;

    /**
     * Set mouse listener.
     * 
     * @param mouseListener MapMouseListener
     */
    public void setMouseListener(MapMouseListener mouseListener)
    {
        this.mouseListener = mouseListener;
    }

    /**
     * Build game map frame.
     * 
     * @param gameMap GameMap
     * @return JMapFrame
     */
    public JMapFrame buildMapFrame(GameMap gameMap)
    {
        JMapFrame mapFrame = new JMapFrame(gameMap);
        mapFrame.initialize();
        mapFrame.getContentPane().addMouseListener(mouseListener);

        return mapFrame;
    }
}
